home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / PASCAL / ALLSWAGS.ZIP / SWAGN-R.ZIP / NETWORK.SWG / 0036_Netware 3.11 API - Convert Numeric forma.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-11-29  |  1.8 KB  |  74 lines

  1. {
  2.             ╔══════════════════════════════════════════════════╗
  3.             ║     ┌╦═══╦┐┌╦═══╦┐┌╦═══╦┐┌╦═╗ ╦┐┌╦═══╦┐┌╔═╦═╗┐   ║
  4.             ║     │╠═══╩┘├╬═══╬┤└╩═══╦┐│║ ║ ║│├╬══      ║      ║
  5.             ║     └╩     └╩   ╩┘└╩═══╩┘└╩ ╚═╩┘└╩═══╩┘   ╩      ║
  6.             ║                                                  ║
  7.             ║     NetWare 3.11 API Library for Turbo Pascal    ║
  8.             ║                      by                          ║
  9.             ║                 S.Perevoznik                     ║
  10.             ║                     1996                         ║
  11.             ╚══════════════════════════════════════════════════╝
  12. }
  13. Unit NetConv;
  14.  
  15. {
  16.  This is service unit.
  17.  It's contains functions for convert numeric formats
  18. }
  19.  
  20. Interface
  21.  
  22. Function Int2Long (B,C : word) : LongInt;
  23.  
  24. Procedure Long2Int(A: longint; var B,C : word);
  25.  
  26. Function GetWord(P: pointer): word;
  27.  
  28. Function GetLong(P: pointer): LongInt;
  29.  
  30. Implementation {-----------------------------------------------------------}
  31.  
  32. Procedure Long2Int(A: longint; var B,C: word); assembler;
  33. asm
  34.           PUSH ES
  35.           PUSH SI
  36.           LES  AX, A
  37.           MOV  BX, ES
  38.           LES  DI, B
  39.           MOV  ES:[DI], BX
  40.           LES  DI, C
  41.           MOV  ES:[DI], AX
  42.           POP  SI
  43.           POP  ES
  44. end;
  45.  
  46. Function Int2Long (B,C : word) : longint; assembler;
  47. asm
  48.           MOV AX, C
  49.           MOV DX, B
  50. end;
  51.  
  52.  
  53. function GetWord(P: pointer): word; assembler;
  54. asm
  55.           PUSH ES
  56.           LES  DI, P
  57.           MOV  AX, word ptr ES:[DI]
  58.           XCHG AH, AL
  59.           POP  ES
  60. end;
  61.  
  62. Function GetLong(p:Pointer) : LongInt; assembler;
  63. asm
  64.           PUSH ES
  65.           LES  DI, P
  66.           MOV  AX, word ptr ES:[DI+2]
  67.           MOV  DX, word ptr ES:[DI]
  68.           XCHG AH, AL
  69.           XCHG DH, DL
  70.           POP  ES
  71. end;
  72.  
  73. end.
  74.